#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<ctime>
using namespace std;
struct Student
{
	string sName;
	int score;

};
struct Teacher
{
	string tName;
	struct Student sArr[5];
};
void Chang_Space(struct Teacher tArr[], int len)
{
	for (int i = 0; i < len; i++)
	{
		string nameseed = "ABCDE";
		tArr[i].tName += nameseed[i];
		for (int j = 0; j < 5; j++)
		{
			int radom = rand() % 61 + 40;
			tArr[i].sArr[j].sName += nameseed[j];
			tArr[i].sArr[j].score = radom;
		}
	}
}
void Print(struct Teacher tArr[], int len)
{
	for (int i = 0; i < len; i++)
	{
		cout << "老师的名字：" << tArr[i].tName << endl;
		for (int j = 0; j < 5; j++)
		{
			cout << "\t学生的名字：" << tArr[i].sArr[j].sName << " 学生的成绩是：" << tArr[i].sArr[j].score << endl;
		}
	}

}
int main()
{
	struct Teacher tArr[3];
	srand((unsigned int)time(NULL));
	//创建三个老师的数组
	int len = sizeof(tArr) / sizeof(tArr[0]);
	//用函数调用实现老师数组的赋值，并且给其所带的学生赋值
	Chang_Space(tArr, len);
	//打印输出所有老师和他们所带的所有学生的信息
	Print(tArr, len);
	system("pause");
	return 0;
}